<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <title>已添加生产企业数</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<input type="hidden" name="projId" id="projId" value="${projId }"/>
<input type="hidden" name="projName" id="projName" value="${projName }"/>
    <section class="content-header">
        <h1>已添加生产企业</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active">药品招标管理</li>
            <li class="active">采购项目管理</li>
            <li class="active">招标项目查看</li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                        <label for="txtDrugName">企业编码：</label>
                        <input class="form-control" type="text" id="compCode" name="compCode" placeholder="企业编码" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label for="txtDrugForm">企业名称：</label>
                        <input class="form-control" type="text" id="compName" name="compName" placeholder="企业名称" />
                    </div>
                    
                    <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm">查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

        <div class=" box box-warning bottongroup">
            <a href="${ctx }/bidProject/toList.html" class="btn btn-default btn-sm">返&nbsp;回</a>
        </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
        $(function () {

            
        	
            $("#gridlist").jqGrid({
                url: "${ctx}/bidProject/getJoinProCompDataList.html?projId=${param.projId}",
                mtype: "POST",
                datatype: "json",
                postData: { "projId" : "${projId}"},
                autowidth: true,
                height: 270,
                colNames: ['projProdcompId','compId', '企业编码', '企业名称', '组织机构代码', '所属地区', '企业类型', '企业注册类型' , '状态' ],
                colModel: [
                    { name: 'projProdcompId', key:true,hidden:true, width: 40, align: 'center' ,sortable: false},
                    { name: 'compId', key:true,hidden:true,width: 40, align: 'center' ,sortable: false},
                    { name: 'compCode', width: 80 , align:"center",sortable: false,
                    	formatter:function(cellvalue, options, row){ 
                    		return "<a href=\"javascript:$.HN.dialog.opendialog('"+row.compId+"','企业详情','${ctx}/stdCompinfo/toStdCompinfoDetail.html?compId="+row.compId+"','800px','400px',function operResult(val){return operResult;})\">"+cellvalue+"</a>"
                    				}
                    },
                    { name: 'compName', width: 120, align: 'left' ,sortable: false},
                    { name: 'orgCode', width: 80, align: 'center' ,sortable: false},
                    { name: 'areaName', width: 90, align: 'center' ,sortable: false},
                    { name: 'compType', width: 60,hidden:true, align: 'center' ,sortable: false},
                    { name: 'compRegName', width: 60, align: 'center' ,sortable: false},
                    { name: 'status', width : 40, align : 'center', sortable : false}
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                multiselect: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "${name} -已添加生产企业 ",
                //序号宽度自动变化
                gridComplete:function(){     
                    var page = $("#gridlist").jqGrid('getGridParam','page');
                    var rows = $('#gridlist').getGridParam("rowNum");
                    var maxnum = (rows*page).toString();
                    var len = (maxnum.length)*10;
                    $('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                    $('#gridlist_rn').css('width',len+'px');
                },
                jsonReader: {
                    repeatitems: false  
                },
                loadComplete: function (data) { //完成服务器请求后，回调函数
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
            $("#hospClassify").HNSelect({
                url: "${pageContext.request.contextPath}/selectController/getDicSys.html", data: { ID: '113' },defaultselect:'${form.patternType}',  defaultText: "<option value=''>请选择</option>",
            });
            
           
        });
        //查询
        function gridSerch() {
        	var compCode = $.trim($("#compCode").val());
        	var compName = $.trim($("#compName").val());
        	var	status = $.trim($("#status").val());
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{"compCode":compCode,
    	        		"compName":compName,
    	        		"status":status,
    	        		"projId":$("#projId").val()},
    	        		page:1
    	    }).trigger("reloadGrid"); //重新载入  
    	}
        
        
         
        
    </script>
</body>
</html>
